--------------------------------------
Introduction
--------------------------------------
This map is far from comprehensive. I have no interest in dissecting the game further, but my Cheat Engine cheat table is provided if anyone wants to build upon it.

Some of the entries or layouts in the cheat table are inconsistent; I apologize for this, but the only way to update them is manually, which I am not doing.

To make mods for the game, use any archiving software with disc image compatibility to extract the DDS3.IMG and DDS3.DDT files from the disc, then use QuickBMS with the Shin Megami Tensei: Nocturne script to extract the individual files from DDS3.IMG. After making changes, bundle your modified files into DDS3.IMG once again and repack it into the main disc image with any capable software.

Cheat Engine: https://cheatengine.org/
QuickBMS: https://aluigi.altervista.org/quickbms.htm

--------------------------------------
Note on ID Numbers
--------------------------------------
Items, skills, and characters are stored as ID numbers that correspond to the order of their entry in the relevant database. If you want to check what an ID number refers to, you can look it up in the text database. Every name string for a given object type has the exact same length, so the name can be found algorithmically by multiplying the ID number by the string length and adding it to the text table base.

(Most ID numbers in the cheat table are in hex, but some of them aren't. Sorry, but I'm not manually updating thousands of entries to fix it.)

Items:		0x2102FC80 + ID*[25 or 0x19]
	(includes key items, bullets, and karma rings)
Skills:		0x21031580 + ID*[17 or 0x11]
Enemies:	0x2102E300 + ID*[17 or 0x11]
Mantras:	0x2101BA00 + ID*[19 or 0x13]

Here's a list of frequently-appearing items for convenience (numbers in decimal):
1 = Ration
2 = Brave Ration
3 = Hero Ration
6 = Medical Kit
7 = Medical Tool
8 = Medical Gear
9 = Chakra Drop
11 = Chakra Pot
12 = Great Chakra
13 = Soma Drop
14 = Soma
15 = Muscle Drink
16 = Revival Bead
17 = Revival Gem
21 = Dis-Poison
22 = Dis-Ache
23 = Dis-Mute
24 = Dis-Stun
25 = Dis-Stone
26 = Dis-Curse
27 = Panacea
28 = Odd Morsel
29 = Moldy Roll
30 = Rancid Gravy
34 = Magic Mirror
35 = Attack Mirror
36 = Dekaja Rock
38 = Molotov
39 = Fire Bomb
40 = Ice Blast
41 = Frost Bomb
42 = Thunder Rod
43 = Shock Bomb
44 = Sonic Stone
45 = Impact Bomb
46 = Land Mine
47 = Magni Bomb
48 = Holy Arrow
49 = Dark Veil
54 = Wild Card
56 = Wild Bomb
59 = Estoma Spray
60 = Magic Reed
61 = Core Shield
62 = Light Ball
66 = Fire Wall
89 = Power Data
90 = Vital Data
91 = Magic Data
92 = Quick Data
93 = Luck Data
94 = HP Data
95 = MP Data
97 = Clover
98 = Narcissus
99 = Amaryllis
100 = Daisy
101 = Rose
102 = Sakura
103 = Jasmine
104 = Manjusaka
105 = Olive Branch
109 = Cat's Eye
110 = Tiger's Eye
111 = Malachite
112 = Blue Diamond
113 = Red Diamond
114 = Hope Diamond
115 = Yellow Crystal
116 = Pink Crystal
117 = Purple Crystal
118 = Ruby
119 = Blood Ruby
120 = Star Ruby
121 = Pearl
122 = Scarlet Pearl
123 = Black Pearl
124 = Sapphire
125 = Pink Sapphire
126 = Star Sapphire

**********************************************
RAM (Random-Access Memory)
**********************************************
Temporary storage for relevant variables and calculations during gameplay.

======================================
Character Data
======================================
--------------------------------------
Party
--------------------------------------
0x21174D60: Character #1
0x21174F28: Character #2
0x211750EC: Character #3
0x211752B0: Character #4
0x21175474: Character #5
	(Characters are listed in the same order they appear in the party menu. Changing party order will swap the characters' data between these positions.)

Each entry has the following format:
0x000: Bit flags, 2 bytes
	01XX: present
	02XX: in active party
	04XX: always seems to be set, purpose unknown
	10XX: berserk mode
	XX08: demon form
0x004: Character ID#, 2 bytes
	01 = Serph
	02 = Sera
	03 = Heat
	04 = Argilla
	05 = Gale
	06 = Cielo
	07 = Roland
	08 = Seraph
	09 = True Heat
	(any other values will hang when status menu is opened)
0x006: HP (2 bytes)
0x008: Max HP (2 bytes)
0x00A: MP (2 bytes)
0x00C: Max MP (2 bytes)
0x00E: Status Ailment (Bit flags, 2 bytes)
	(only one can be active at a time, if you try to stack them weird things happen)
	01XX: Fear
	02XX: Shock
	04XX: Freeze
	08XX: Sleep
	10XX: Mute
	20XX: Panic
	40XX: Ache
	80XX: Poison
	XX01: Paralyze
	XX02: Charm
	XX04: Curse
	XX08: Stone
	XX10: Bat (exclusive to Camazotz battle)
	XX20: Bind (exclusive to Kumbhanda battle)
	XX40: KO
	XX80: Forced reversion
0x010: Karma (4 bytes)
0x014: Level (2 bytes)
0x016-0x01A: Core stats (STR, VIT, MAG, AGL, LUK in that order)
0x022: Set skills (array length 2x8)
	(each element is a skill ID#, 2 bytes)
0x042: Equipped Bullet ID#
0x045: Equipped Mantra ID#
0x048-0x1A7: Learned skills
	Each nibble is 1 skill. 1 = learned, 5 = learned and new (gets the "!" marker in set menu)
	Follows database order INCLUDING cut skills
0x1B2: Equipped Ring ID#
0x1B4-0x1C4: Unknown

--------------------------------------
Reserve
--------------------------------------
Stores data when characters leave the party. Blanked when characters rejoin.

0x21190ED4: Serph
0x21191098: Sera
0x21191420: Argilla
0x211915E4: Gale
0x211917A8: Cielo
0x2119196C: Roland
0x21191B30: Seraph
	(yes, Seraph has a block even though they never leave the party)
0x21191CF4: True Heat

Entries have same format as regular party data.

======================================
Battle Variables
======================================
--------------------------------------
Scan readout
--------------------------------------
Data displayed by scan readout when using Analyze/Spyglass.
	0x203B6810: List of skills by ID#. Each ID# is 2 bytes.
	0x203B6828: Elemental affinities info.

--------------------------------------
Battle results
--------------------------------------
This is updated whenever enemies are killed. Tweak it before the end of battle to get whatever you want.
	Item drops: 2 bytes ID# followed by 2 bytes for item quantity.
		Drop #1: 0x20D1F45C
		Drop #2: 0x20D1F460
		Drop #3: 0x20D1F464
		Drop #4: 0x20D1F468
	0x20D1F46C: Money (4 bytes)
	0x20D1F470: Karma (4 bytes)
	0x20D1F478: AP (2 bytes)

--------------------------------------
Turn icons
--------------------------------------
0x20D1F47E (array length 2x8)
This is an array, and is shifted by 1 element when a turn icon is depleted. Each element is 2 bytes. The first byte is the position of the turn icon in the queue, and the value of the second byte determines whether it is full (0x64) or blinking (0x32). The size of the array means the maximum possible number of turn icons is 8.

--------------------------------------
Battler data
--------------------------------------
0x20D20AA0: Player Character #1
0x20D20E20: Player Character #2
0x20EB7BA0 (mind the gap): Player Character #3
0x20EB7F20: Enemy #1
	(further enemy entires are consistently successive)

Each entry has the following format:
	0x000-0x1B2: Identical to party data
	0x1C6: STR buff stage (2 bytes signed)
	0x1CC: MAG buff stage (2 bytes signed)
	0x1D2: accuracy or evasion buff stage (2 bytes signed)
	0x1D8: DEF buff stage (2 bytes signed)
	0x1DE: evasion or accuracy buff stage (2 bytes signed)
	0x1E4: Power Charge (2 bytes but effectively Boolean)
	0x1EA: Mind Charge (2 bytes but effectively Boolean)
	0x1F0: Active shield skill ID# (4 bytes)
	0x1F4-0x380: Unknown

======================================
Inventory
======================================
0x2117433C: Money (4 bytes)
0x21192954: Shop Points (4 bytes)
0x21192958: Shop Rank (4 bytes, for some reason)

0x21175641: Inventory start
	Each byte corresponds to an item, following the database order. The value of each byte is how much of that item you have. Ammo and karma rings follow directly from consumables and work the same way, even though the game won't register more than 1 of a given karma ring.

The location of the key item inventory is unknown.

--------------------------------------
Mystery Boxes
--------------------------------------
These addresses hold the ID# of the first 2 items to be obtained by mystery boxes. Entries are 0x44 bytes in size, but only the first 4 seem to be used. Purpose and mechanics poorly understood.

0x20CD8F8: Crimson Box #1
0x20CD93C: Crimson Box #2
0x20CD980: White Box #1
0x20CD9C4: White Box #2
0x20CDA08: Golden Box #1
0x20CDA4C: Golden Box #2

======================================
Misc
======================================
0x21174334: Playtime counter (4 bytes). Conversion rate to seconds is unknown.

[[0x20D1F200]+0x2000001C]+0x20000060: While in the terminal teleport menu, holds the ID of the selected destination terminal.
	Modifying this will let you teleport anywhere, but note that most terminal IDs were unused and will take you to a black screen of death.

0x21174300: Seems to be data written to save files. Presumably contains useful things like event flags if you can decode it.
	0x21174308: Playtime
	0x21174310: Array 1x5, party order (each element is character ID#)
	0x21174305: ID# of terminal used to save

**********************************************
ROM (Read-Only Memory)
**********************************************
Memory addresses used to store immutable data. These sections correspond to the files that can be found by unpacking the disc image.

Typically, data relating to mechanics unique to Digital Devil Saga (mantras, Mad Mart, etc.) are contined within the ELF file on the disc, while data relating to mechanics shared with Shin Megami Tensei 3: Nocturne are stored within the DDS3.IMG file and require QuickBMS to extract.

======================================
TEXT
======================================
Most of this data is located inside DDS3.IMG/battle/MSG.TBL within the disc, but some specific messages may be stored in more specific locations (such as DDS3.IMG/facility for shop and terminal-related messages).

Note that there are many entries with placeholder or empty text.

--------------------------------------
Strings
--------------------------------------
These strings all have uniform length, even if their text does not use the whole length. This avoids the need for a text pointer table, as strings can be retrieved algorithmically using only the object's ID number.

0x2039A1D0: Locations (length 24)
	-NOTE: these strings contain additional data in leading bytes
	0x2039A5AC: Subareas (length 30)
	0x2039E1AC: Points of Interest (length 34)
	0x203A25AC: Floors (length 28)
	0x203A41C8: Terminals (length 24)
	0x20400AF0: World map locations (length 24)
		0x20400BB0: Descriptions (length 52)
0x20436790: Menu text (length 8)
	0x204152F8: Prana Beam, Submachine Gun, & Assault Rifle (length 16)
	0x20415318: Withdraw & Transform (length 16)
	0x2042A440: Other (length 16)
0x20437B90: Stat abbreviations
0x204C0BC0: Races (length 6)
0x204C30C0: Character & Atma names (length 16)
0x21018D00: Enemy info (length 45)
0x2101C780: Enemy info (length 188)
0x2101BA00: Mantras (length 18)
0x2102E300: Enemies (length 16)
0x2102FC80: Items (length 24)
	-includes key items, ammo, and karma rings
0x21031580: Skills (length 16)
	-includes combo and auto skills
0x21034280: Combo components (length 32)
	0x2042AD78: Gun components (length 16)

--------------------------------------
Messages
--------------------------------------
Messages have nonuniform length, and so do have pointer tables. Each pointer points to the message's code name, which includes several formatting codes before the text itself.

NOTE: Because messages use formatting codes such as line breaks and special terminators, editing them is not recommended without the aid of software, as it is very easy to render the whole string illegible by breaking the formatting or throwing off the text pointers by accidentally adding or removing bytes.

0x20385228: Battle tutorial messages
	0x2038524C: Pointer table
	0x20385298: Text
0x203A9EB0: Field Hunt messages
	0x203A9ED4: Pointer table
	0x203A9F20: Text
0x203B52D0: Combo skill tutorial messages
	0x203B52F4: Pointer table
	0x203B5318: Text
0x203C99B8: "This event cannot be skipped."
0x203D05C8: Battle result messages
	0x203D05EC: Pointer table
	0x203D0B18: Text
0x203E5778: Item messages
	0x203E579C: Pointer table
	0x203E58E0: Text
0x203E69B0: Menu help text
	0x203E69D4: Pointer table
	0x203E6A60: Text
	0x203e7050: Items submenu
		0x203E7074: Pointer table
		0x203E70A8: Text
	0x203E7600: Skills submenu
		0x203E7624: Pointer table
		0x203E7640: Text
0x20405CA8: Mantra descriptions
	0x20405CCC: Pointer table
	0x20406558: Text
0x204287E0: Credits
0x204C34C0: Basic action help text
	0x204C34FC: Pointer table
	0x204C3538: Text
0x21010828: In-battle dialogue
	0x2101084C: Pointer table
	0x21010F40: Text
0x21034900: Item descriptions
	0x21034924: Pointer table
	0x21035130: Text
0x21039C80: Skill descriptions
	0x21039CA4: Pointer table
	0x2103B1B0: Text
0x21047700: Battle messages
	0x21047724: Pointer table
	0x21047F20: Text

--------------------------------------
Dialogue
--------------------------------------
Each section contains an additional subsection after dialogue text that contains speaker names. Speaker names, like dialogue text, are mapped to a pointer table. Speakers appear to be listed in order of appearance by dialogue messages, but they are not mapped 1:1 to each message.

In the unpacked file, this data is contained in the "event" folder.

Dialogue data for the current area appears to be stored at one of several locations in RAM, but the ROM source location is unknown.
	0x211E42FC: 
	0x212F86F0: Surface of the Sun?
	0x21309C6C: The Sun 2nd-4th layer?
	0x2130E060: The Sun 5th-6th layer?
	0x2134F97C
	0x213519FC	

======================================
MANTRAS
======================================
This data is contained within the ELF file (SLUS_211.52 for the US version) within the disc.

Mantra data begins at 0x20401348 and follows the order given in the mantra name list. Note that this means some mantras, especially capstones, are ordered nonintuitively.
Entries are 0x24 bytes in size and have the following format:
	0x00: Difficulty, 1 byte. Appears to be purely cosmetic as AP requirement is stored elsewhere.
	0x02: Unknown, always 1
	0x04: AP required for mastery, 4 bytes.
		(AP requirements are consistent across difficulty which raises questions of why this had to be coded individually for each mantra, who knows)
	0x08: Unknown, always 0
	0x0E: Skill list, array 2x4, each element is skill ID#
	0x16-0x24: Unknown

Additional mantra data is stored starting at 0x2042C10. Entries are 0x2C bytes in size and have the following format:
	0x00: Unknown, always 0x20
	0x08: Price, 4 bytes
	0x0C-0x13: Unknown, always 0
	0x14: Boolean, if 1 mantra is hidden until reveal criteria met
	0X18: ID# of mantra that must be mastered to reveal
	0x19-0x2C: Unknown

======================================
SKILLS
======================================
This data is located in DDS3.IMG/battle/SKILL.TBL in the disc.

Data (probably) begins at 0x20F87E80 and follows the order given in the skill name list, including cut/dummy skills. In my cheat table, they're grouped more intuitively.
Entries are 0x38 bytes in size and have the following format:
	0x00: Bit flags
		01: Consistently set for nondamanging skills but has seemingly no effect if set on damaging skills
		02: Consistently set for draining skills but has seemingly no effect if changed
		08: Kills user
		10: Only seen in God's Breath and Retribution, purpose unknown
		20: Devour on kill
	0x01: If 2, usable in battle. If 3, also usable in menu. If < 2, unusable.
	0x02: Bit flag, attack type (skill always fails if > 2)
		01: Magical
		02: Fatal hunt
	0x03: Bit flag, cost type
		01: %HP
		02: MP
		(any other value will use absolute HP)
	0x04: Cost (% if HP)
	0x08: Boolean, if 1 targets all
	0x09: Bit flag, allowed targets
		01: Allies
		02: Enemies
		08: Also set for ally targeting but seemingly no effect
	0x10: Unknown, always 1
	0x11: % Accuracy
	0x14: Minimum # of hits
	0x15: Maximum # of hits
	0x16: Behavior
		00: No primary effect
		01: Damaging
		02: Healing
		03: Reduce target HP to {power} (used exclusively by Desert Wind)
		04: Desperate strength (physical)
		05: Heal by fixed amount
		08: Cut HP by {power}%
		0B: Heal by {power}% of target HP
		0C: Drain HP
		0F: Desperate strength (Spiteful Force)
	0x18: Power
	0x1C: Used in skills that affect MP (MP Thief, MP recovery items)
		(frequently set to 50 even for skills that don't affect MP, purpose unknown)
	0x22: Unknown, always 100
	0x24: Ailment behavior
		01: inflict
		02: cure
		03: inflict random from set
	0x25: Status ailment infliction/cure % chance
	0x26: Status ailment
		(don't set multiple with behavior 01, game will get confused and hang on enemy's turn)
		01XX: Fear
		02XX: Shock
		04XX: Freeze
		08XX: Sleep
		10XX: Mute
		20XX: Panic
		40XX: Ache
		80XX: Poison
		XX01: Paralyze
		XX02: Charm
		XX04: Curse
		XX08: Stone
		XX10: Bat (exclusive to Camazotz battle)
		XX20: Bind (exclusive to Kumbhanda battle)
		XX40: KO
		XX80: Forced reversion
	0x28: Bit flags, stat changes
		(Note: accuracy and evasion are separate values but are always affected together by Sukukaja/Sukunda, so it's impossible to know which is which)
		XX01: Tarukaja
		XX02: Tarunda
		XX04: Makakaja
		XX08: Makanda
		XX10: Sukukaja*
		XX20: Sukunda*
		XX40: Rakukaja
		XX80: Rakunda
		01XX: Sukukaja*
		02XX: Sukunda*
		04XX: Power Charge
		08XX: Dejaka
		10XX: Dekunda
		20XX: Mind Charge
			(I assume the reason Mind Charge comes out of order is because the game was built on the SMT3 engine, which didn't have Mind Charge)
	0x2C: Stat stages, or variable used by special effect
	0x2D: Only nonzero in hunt skills, purpose unknown
	0x2E: Element shield type (NOT the same as skill ID#)
	0x30: Special effect
		(most of these will hang or just do nothing if used by player)
		01: Analyze
		02: call reinforcement
		03: escape
		04: only targets sleeping (Calm Death)
		09: generates turn icons
		0A: drop item
		0C: Camazotz Guard		
		10: Gate to Abyss
		11: Regurgitate
		15: lose money
		16: eject target (Desert Wind)
		17: unknown (Retribution)
		63: used by Vanity and Celestial Ray, presumably something to do with ailments
	0x34: Crit rate
		(...but is also set for magic skills, which can't crit, purpose unknown)
	0x36: Always 24 except in HP Thief and hunt skills, purpose unknown
	0x38: Purpose unknown. Always 0x79 except in HP Thief. Heals massive HP & MP if > 80.

There appears to be no data corresponding to element. How the game attaches elements to skills is unknown.

======================================
ENEMIES
======================================
This data is located at DDS3.IMG/battle/UNIT.TBL in the disc.

Data (probably) begins at 0x20F93484 and follows the order given in the enemy name list, including cut/dummy enemies. In my cheat table, they're grouped by race.
Entries are 0x4C bytes in size and have the following format:
	0x00: Race ID#
		(corresponds to list in text bank)
	0x01: Level
	0x02: HP
	0x04: Max HP
		(Yes, current and max are separate values; if they differ, enemy will spawn already injured)
	0x06: MP
	0x08: Max MP
	0x0C-0x010: Core stats (STR, VIT, MAG, AGL, LUK in that order)
	0x11: Turn icons
	0x14: Skills, array 2x8
		(seemingly cosmetic, only purpose seems to be for scan readout)
	0x24: Money
	0x26: Karma
	0x28: AP
	0x2C: Devour AP
	0x2E-0x39: Unknown, look like bit flags
	0x3A: Drop 1 ID#
		0x3C: % chance
	0x3B: Drop 2 ID#
		0x3D: % chance
	0x3E-0x4C: Unknown, look like bit flags

There appears to be no data corresponding to elemental affinity. How the game attaches affinities to enemies is unknown.

======================================
ITEMS
======================================
--------------------------------------
Mad Mart
--------------------------------------
This data is contained within the ELF file (SLUS_211.52 for the US version) within the disc.

Mystery box data: Each box is 0xC0 bytes in size, consisting of 10 elements each 0x0C bytes in size. Each element contains the % chance of the item appearing, then the item ID#. (NOTE: Percentages do not add up to 100%, so I may be mistaken about this.) Each type of mystery box appears to actually have 3 separate draw pools, but I do not know the significance of this.
	0x20CDA88: Crimson Box
	0x20CDB48: Crimson Box (alt?)
	0x20CDC08: Crimson Box (alt 2?)
	0x20CDCC8: White Box
	0x20CDD88: White Box (alt?)
	0x20CDE48: White Box (alt 2?)
	0x20CDF08: Golden Box
	0x20CDFC8: Golden Box (alt?)
	0x20CE088: Golden Box (alt 2?)

0x203CE148: Customer rank data. Each entry is 0x0C bytes in size, consisting of 2 elements. First is buyback % (absolute), second is the total points required for the next rank up. (For rank 7, the second element is 0.)

0x203CE1AC: Lottery data. Each entry is 0x48 bytes in size, consisting of 4 elements.
	0x00: Shop points required to trigger.
	0x04: Object ID# (?)
	0x0C-0x48: Item ID#, each 8 bytes for some reason.
		(there is enough space for at least 4 more items than the 3 given by each lottery; possibly the lotteries were supposed to be bigger at one point in development?)

0x203CE6E8: Appears to be some kind of data structure. Purpose unknown, but ID# places it immediately after customer rank data and before mystery box data, so likely related to Mad Mart.

======================================
OTHER
======================================
Unpacking the disc image yields additional table files that have not been examined beyond identifying their location in the compiled game:
	0x20FA1880: ENCOUNT.TBL
	0x20FBCF80: AICALC.TBL
	0x2108EB80: EFFECT.TBL